from google.appengine.ext import db
from google.appengine.api import users


class User(db.Model):
    user = db.UserProperty()
    email = db.EmailProperty()
    age = db.StringListProperty()
    interests = db.StringListProperty()

    @classmethod
    def get_current_user(cls):
        user_list = cls.all().filter("user =", users.get_current_user())
        if user_list.count():
            return user_list[0]

        return None
